//------------------------------------------------------------------------------
// <copyright file="RestoreDefaultSettingsControl.xaml.cs" company="Damian Antonowicz">
//       copyright © 2010 Damian Antonowicz
// </copyright>
// <author>Damian Antonowicz</author>
// <email>poczta@damianantonowicz.pl</email>
//------------------------------------------------------------------------------

using System.Windows;
using DotBeer.Data.Properties;

namespace DotBeer.UI.WPFClient
{
    /// <summary>
    /// Interaction logic for RestoreDefaultSettingsControl.xaml
    /// </summary>
    public partial class RestoreDefaultSettingsControl : IOptionsControl
    {
        public RestoreDefaultSettingsControl()
        {
            this.InitializeComponent();
        }

        #region IOptionsControl Members

        public bool Save()
        {
            return true;
        }

        public void Cancel()
        {
        }

        #endregion

        private void ButtonRestoreSettings_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = CustomMessageBox.Show("Are you sure? You won't be able to undo this operation.",
                                                            "Confirm",
                                                            MessageBoxButton.YesNo);

            if (result == MessageBoxResult.Yes)
            {
                CopyItemBuildSettings.Default.Reset();
                CopyItemBuildSettings.Default.Save();

                CopySkillBuildSettings.Default.Reset();
                CopySkillBuildSettings.Default.Save();

                DisplayOptionsSettings.Default.Reset();
                DisplayOptionsSettings.Default.Save();

                ItemsCollectionControlSettings.Default.Reset();
                ItemsCollectionControlSettings.Default.Save();

                UpdateSettings.Default.Reset();
                UpdateSettings.Default.Save();

                WindowMainSettings.Default.Reset();
                WindowMainSettings.Default.Save();

                WindowsPositionSettings.Default.Reset();
                WindowsPositionSettings.Default.Save();

                WindowsBindingsSettings.Default.Reset();
                WindowsBindingsSettings.Default.Save();
            }
        }
    }
}
